﻿
Partial Class LogPreview
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Session("StaffId") Is Nothing Then
            Response.Redirect("Default.aspx")
        Else
            lblStaffUID.Text = Session("StaffId").ToString
        End If

        Dim strLog As String

        strLog = ReadLog()
        Log.Text = strLog.Replace(vbCrLf, "<br />")

    End Sub

    Public Shared Function ReadLog() As String
        'Dim strLogPath As String = "D:\Cloud\SkyDrive\LSK\File\Log.txt"
        Dim strLogPath As String = "C:\REM_TEST\File\Log.txt"
        Dim oRead As System.IO.StreamReader
        Dim contents As String

        oRead = System.IO.File.OpenText(strLogPath)

        contents = oRead.ReadToEnd()

        oRead.Close()

        Return contents
    End Function

End Class
